; Sound-producing loops
; 26 * HL cycles with the DLoop
; 80 cycles with the rest of the soundloop
PlaySound:
	call SafeInterruptDI
	push af	; back up interrupt state in stack
_		push hl				; 11
_			dec hl			; 6
			ld a,h			; 4
			or l			; 4
			jr nz,-_		; 12	; 7
		pop hl				; 10
		ld a,b				; 4
		xor  00000011b			; 7
		ld b,a				; 4
		out (0),a			; 11
		dec de				; 6
		ld a,d				; 4
		or e				; 4
			jr nz,--_		; 12
	pop af		; recall interrupt state
		ret c	; if it was off just end the routine
	ei		; otherwise enable interrupts
	ret		; then return
